i=100
while i<=999:
    num=i
    sum=0
    for j in range(0, 3):
        sum = sum + (num % 10) ** 3
        num = int(num / 10)
    if i==sum:
        print(i)
    i+=1